<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\assets\CropperAsset;

CropperAsset::register($this);
$this->registerCssFile("/css/pic.css");
$this->registerCssFile("/css/cropper.css");
$this->registerJsFile("/js/pic.js", ['depends' => 'yii\web\JqueryAsset']);
$this->title = '影像资料';
?>
<div class="container crop-avatar">

  <ul class="mj-pics">
    <li id="add-pic">
      <!-- Current avatar -->
      <div class="avatar-view" title="Add picture">
        <img src="../../images/add.png" alt="Avatar">
      </div>
    </li>

    <?php for ($i = count($filenames) - 1; $i >= 0; $i --) :?>

    <li>
      <a href="/media/view?id=<?= $filenames[$i] ?>&type=media" target="_blank">
        <img src="../../images/upload/media/<?= $filenames[$i] ?>" alt="Avatar" title="<?= $filenames[$i] ?>">
      </a>
      <!-- <div class="close-btn close" id="<?php // preg_replace('/\.jpg/', '', $filenames[$i]) ?>"><i class="fa fa-times fa-2x"></i></div> -->
      <span><?= $filenames[$i] ?></span>
    </li>

    <?php endfor; ?>

  </ul>

  <input type="hidden" id="pic-name" value="media/<?= date('YmdHis') ?>">
  <?= $this->render('@app/views/layouts/media.php') ?>
  
</div>
